package com.share.demo.jvm;

/**
 * author:caifan
 * date:2019/10/4
 *
 * 此程序会导致电脑假死
 */
public class VMStackOOM {
    private void overStart() {
        while (true) {}
    }


    public void stackLeakByThread() {
        while (true) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    overStart();
                }
            }).start();
        }
    }

    public static void main(String[] args) {
        VMStackOOM vmStackOOM = new VMStackOOM();
        vmStackOOM.stackLeakByThread();
    }
}
